﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Chapter3Applications.Models.PersistentModel
{
    [MetadataType(typeof(ShoppingListAnnotations))]
    public partial class ShoppingList
    {
        // No field here
    }

    //non-sealed because of virtual! Is this right?
    internal class ShoppingListAnnotations
    {
        public int ShoppingListId { get; set; }

        [Required(ErrorMessage = "Please enter a shopping list name")]
        public string ShoppingListName { get; set; }

        public virtual ICollection<Product> Product { get; set; }
    }
}